package application;

import java.io.Serializable;

import dataStructures.*;
/**
 * @author Carlos Duarte - 43796
 * @author Rafael Florencio - 43829
 */
public interface Text extends Serializable {
	
	/**
	 * Add a line to the text
	 * @param line == input by user
	 * @param lines 
	 */
	public void addLine(String line, int lines);
	
	/**
	 * Get id of text
	 * @return id
	 */
	public String GetID();
	
	/**
	 * Get word state from dictionary
	 * will go to dictionary find if the word exist there
	 * and will return the state to save in word class
	 * @param Rword == word from line to search in dictionary
	 * @param RDictionary == dictionary where is search the word
	 * @return c == palavra correta, e == erro ortografico
	 */
	public String GetWordState(String Rword);
	
	/**
	 * get line of postion in array
	 * @param position == position in array
	 */
	public String getLine(int position);
	
	/**
	 * get all text or part of text
	 * @param minimumLine == represent the first line to read
	 * @param maximumLine == represent last line. If this param has value 0
	 * represent will read all text
	 * @return
	 */
	public String getText(int minimumLine, int maximumLine);
	
	/**
	 * List all words of a certain type
	 * @param type
	 * @return
	 */
	public Iterator<Word> listWordByType(String type);
	
	/**
	 * Check if the word exists in the line
	 * @param word == word to check
	 * @return true if it exists, false if it doesn't
	 */
	public boolean hasWord(String word);
	/**
	 * Count how many times the word appears
	 * @param Rword
	 * @return
	 */
	public int countWord(String Rword);

	/**
	 * Returns the number of lines the text has
	 * @return
	 */
	public int getnLines();

}
